Skip to content

feat: warn when simp theorem LHS has variable or unrecognized head symbol#13325

Merged
wkrozowski merged 8 commits intoleanprover:masterfrom
wkrozowski:wojciech/simpVarHead2
Apr 13, 2026
Merged

feat: warn when simp theorem LHS has variable or unrecognized head symbol#13325
wkrozowski merged 8 commits intoleanprover:masterfrom
wkrozowski:wojciech/simpVarHead2

Conversation

@wkrozowski
Copy link
Copy Markdown
Contributor

@wkrozowski wkrozowski commented Apr 8, 2026

This PR adds warnings when registering @[simp] theorems whose left-hand side has a problematic head symbol in the discrimination tree:

  • Variable head (.star key): The theorem will be tried on every simp step, which can be expensive. The warning notes this may be acceptable for local or scoped simp lemmas. Controlled by warning.simp.varHead (default: true).
  • Unrecognized head (.other key, e.g. a lambda expression): The theorem is unlikely to ever be applied by simp. Controlled by warning.simp.otherHead (default: true).

@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Apr 8, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

mathlib-lean-pr-testing bot commented Apr 8, 2026

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 2398d2cc66e3b981504e6066e60896476ff14a31 --onto 4f6bcc5adac8d6234a9e3def3675402cb89823c6. You can force Mathlib CI using the force-mathlib-ci label. (2026-04-08 12:51:22)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase d53b46a0f3a7d0822550f4179ca3dab446a3c448 --onto d53b46a0f3a7d0822550f4179ca3dab446a3c448. You can force Mathlib CI using the force-mathlib-ci label. (2026-04-12 20:37:53)
    Forcing Mathlib CI because the force-mathlib-ci label is present, despite problem: - ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 0d7e76ea889bacbe8a55af77b2c5841445ae3f64 --onto d76e5a1886956bb38dc6bd2868260550dc66c309. (2026-04-13 11:13:57)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

leanprover-bot commented Apr 8, 2026

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 2398d2cc66e3b981504e6066e60896476ff14a31 --onto 861bc19e0c1c45b5766cc5c9ef0488568368b236. You can force reference manual CI using the force-manual-ci label. (2026-04-08 12:51:24)
  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase d53b46a0f3a7d0822550f4179ca3dab446a3c448 --onto 861bc19e0c1c45b5766cc5c9ef0488568368b236. You can force reference manual CI using the force-manual-ci label. (2026-04-12 20:37:55)
  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase 0d7e76ea889bacbe8a55af77b2c5841445ae3f64 --onto 861bc19e0c1c45b5766cc5c9ef0488568368b236. You can force reference manual CI using the force-manual-ci label. (2026-04-13 11:13:58)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-04-13 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-04-13 11:56:20)

@wkrozowski wkrozowski changed the title feat: add warning for simp lemmas whose LHS is a variable feat: warn when simp theorem LHS has variable or unrecognized head symbol Apr 9, 2026
@wkrozowski wkrozowski added the changelog-language Language features and metaprograms label Apr 9, 2026
@wkrozowski wkrozowski marked this pull request as ready for review April 9, 2026 11:02
@wkrozowski wkrozowski requested a review from leodemoura as a code owner April 9, 2026 11:02
@wkrozowski wkrozowski force-pushed the wojciech/simpVarHead2 branch 2 times, most recently from 8c01b1b to 224dc03 Compare April 13, 2026 11:05
mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 13, 2026
@github-actions github-actions bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Apr 13, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 13, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 13, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 13, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Apr 13, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Apr 13, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@wkrozowski wkrozowski added the merge-ci Enable merge queue CI checks for PR. In particular, produce artifacts for all major platforms. label Apr 13, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 13, 2026
@wkrozowski wkrozowski enabled auto-merge April 13, 2026 15:14
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 13, 2026
@wkrozowski wkrozowski disabled auto-merge April 13, 2026 15:41
@wkrozowski wkrozowski added force-mathlib-ci and removed force-mathlib-ci merge-ci Enable merge queue CI checks for PR. In particular, produce artifacts for all major platforms. labels Apr 13, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Apr 13, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Apr 13, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@wkrozowski wkrozowski added this pull request to the merge queue Apr 13, 2026
Merged via the queue into leanprover:master with commit c4d9573 Apr 13, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-language Language features and metaprograms force-mathlib-ci mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants